#include "subject.h"

void CSubject::SetState(string state)
{
	m_state = state;
}

string CSubject::getState()
{
	return m_state;
}

void CbtnSubject::Attatch(pobjRef pobj)
{
	m_objRefList.push_back(pobj);
}

void CbtnSubject::Detach(pobjRef pobj)
{
	m_objRefList.remove(pobj);
}

void CbtnSubject::notify()
{
	for each (pobjRef pobj in m_objRefList)
	{
		pobj->update(m_state);
	}
}
